import HTMLTestRunner
import unittest
from datetime import time

from com.wzh.mile.unit_test.common.user_info import UserInfo
from com.wzh.mile.unit_test.common.webdriver_single import WebDriverSingle
from com.wzh.mile.unit_test.toumile.mile_suite import suite_register

#循环100次 注册用户
for i in range(100):
    filename = 'D:\user_reports.html'
    with open(filename, 'wb') as fp:
        html_runner = HTMLTestRunner.HTMLTestRunner(stream=fp, title='投米乐自动化测试报告', description='主干流程业务覆盖')
        html_runner.run((suite_register()))
        WebDriverSingle.get_driver().quit()

# filename = 'c:\\user_reports.html'
# with open(filename, 'wb') as fp:
#     html_runner = HTMLTestRunner.HTMLTestRunner(stream=fp, title='投米乐自动化测试报告', description='主干流程业务覆盖')
#     html_runner.run((suite_register()))
#     time.sleep(5)

for i in range(900):
    unittest.TextTestRunner().run(suite_register())
    time.sleep(10)

